package com.itheima.mapper;

import com.itheima.pojo.Emp;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 员工管理
 */
@Mapper
public interface EmpMapper {

    List<Emp> find(String name, Short gender, LocalDateTime begin, LocalDateTime end);

    void delete(List<Integer> ids);

    @Insert("insert into emp ( username, name, gender, image, job, entrydate, dept_id, create_time, update_time) values " +
            "(#{username}, #{name}, #{gender}, #{image}, #{job}, #{entrydate}, #{deptId}, #{createTime}, #{updateTime})")
    void add(Emp emp);

    void update(Emp emp);

    @Select("select * from emp where id=#{id}")
    Emp findById(Integer id);

    @Select("select * from emp where id")
    void DeleteByDeptID(Integer id);

}
